<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>test</title>
		<link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
<div id="split"></div>
	</head>
	<body>
	</body>
	<script src="../js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/global.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
			var isHospital = "0"; //不在科
			var currPage = "1";

			function getListData() {
				$.ajax({
					type: 'POST',
					url: "/service-patient/patient/viewPatientList'", // ajax请求路径
					data: {
						page: currPage, //当前页数
						rows: 10
					},
					dataType: 'json',
					success: function(data) {
						data = JSON.parse(data);
						pageCount = data.data.total;
						// shuju(data.result.dataList);
						paged(data);
					}
				});
			}
			
			function paged(data){
              layui.use(['laypage', 'layer'], function() {
                  var laypage = layui.laypage
                      , layer = layui.layer;
                  var nums =10; //每页出现数量
 
                  laypage({
                      cont:'split' // 容器id
                      , pages: data.data.total //总页数
                      , curr: currPage
                      , jump: function (obj,first) {
                          currPage =obj.curr;  //这里是后台返回给前端的当前页数
                          if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr  ajax 再次请求
                              getListData(currPage);
                          }
                      }
                  });
              });
          }
		  
	</script>
</html>
